<?php

namespace common\models;

use Yii;

/**
 * This is the model class for table "{{%schemes}}".
 *
 * @property integer $id
 * @property string $title
 * @property string $picture
 * @property integer $status
 * @property string $desc
 */
class Schemes extends \yii\db\ActiveRecord
{
    /**
     * @inheritdoc
     */
    public static function tableName()
    {
        return '{{%schemes}}';
    }

    /**
     * @inheritdoc
     */
    public function rules()
    {
        return [
            [['status'], 'integer'],
            [['title', 'picture', 'desc'], 'string', 'max' => 255],
        ];
    }

    /**
     * @inheritdoc
     */
    public function attributeLabels()
    {
        return [
            'id' => 'ID',
            'title' => 'Title',
            'picture' => 'Picture',
            'status' => 'Status',
            'desc' => 'Desc',
        ];
    }
    static public function getAllSchemes($map = [])
    {
        $query = static::find()->where($map)->asArray()->all();

        return $query;
    }
}
